//
//  MainTabBarController.m
//  WashForU
//
//  Created by 王俊 on 15/11/25.
//  Copyright © 2015年 王俊. All rights reserved.
//

#import "MainTabBarController.h"

@interface MainTabBarController ()

@end

@implementation MainTabBarController

- (void)viewDidLoad
{
    [super viewDidLoad];
    [self setUpViews];
    
}
/*****************添加视图组件********************/
- (void)setUpViews
{
    HomePageController *firstPage           = [[HomePageController alloc]init];
    LaundryBasketPageController *secondPage = [[LaundryBasketPageController alloc]init];
    MyPageController *thirdPage             = [[MyPageController alloc]init];
    MorePageController *fourthPage          = [[MorePageController alloc]init];
    self.viewControllers = [[NSArray alloc]initWithObjects:firstPage,secondPage,thirdPage,fourthPage , nil];

    [self customTabBarSet:self.tabBar.items[0] title:@"首页" imgName:@"2-1-tb1-3" selImgName:@"2-1-tb1-2"];
    [self customTabBarSet:self.tabBar.items[1] title:@"洗衣篮" imgName:@"2-1-tb2-3" selImgName:@"2-1-tb2-2"];
    [self customTabBarSet:self.tabBar.items[2] title:@"我" imgName:@"2-1-tb3-3" selImgName:@"2-1-tb3-2"];
    [self customTabBarSet:self.tabBar.items[3] title:@"更多" imgName:@"2-1-tb4-3" selImgName:@"2-1-tb4-2"];
    
    
}
/*****************设置tabBarItem格式********************/
- (void)customTabBarSet:(UITabBarItem *)tabBarItem title:(NSString *)title imgName:(NSString *)imgName selImgName:(NSString *) selImgName
{   
    tabBarItem.title = title;
    tabBarItem.image = [[[UIImage imageNamed:imgName] resetImageSize:CGSizeMake(25, 25)] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    tabBarItem.selectedImage = [[[UIImage imageNamed:selImgName] resetImageSize:CGSizeMake(25, 25)] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
}


- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
}


@end
